package com.hntxk.cqzd.lis.action;

import com.hntxk.cqzd.common.action.CqzdBaseController;
import com.hntxk.cqzd.lis.model.LisBaseModel;
import com.hntxk.cqzd.lis.model.LisModel;
import com.hntxk.cqzd.lis.service.LisInterfaceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Api(value="Lis接口", tags={"[CQZD]Lis接口"})
@Controller
@RequestMapping("cqzd/do/Lis")
public class LisInterfaceController extends CqzdBaseController {
    private final LisInterfaceService service;
    @Autowired
    public LisInterfaceController(@Qualifier("LisInterfaceServiceImpl") LisInterfaceService service) {
        super(service, LogManager.getLogger(LisInterfaceController.class));
        this.service = service;
    }

    /**
     * 获取Lis内容
     *
     * @return
     */
    @ApiOperation(value="获取Lis内容",notes = "产前诊断系统")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "outpatientNo", value = "outpatientNo",example = "1",required = true, dataTypeClass = Long.class),
            @ApiImplicitParam(name = "dict", value = "dict",example = "数字",required = false, dataTypeClass = String.class)
    })
       @GetMapping(value = {"/get/{outpatientNo}/{dict}","/get/{outpatientNo}"}, produces= PRODUCE_UTF8_JSON)
    @ResponseBody
    public List<LisModel> get(@PathVariable String outpatientNo,@PathVariable(required = false) Integer dict){
        return service.getLis(outpatientNo, dict);
    }
}
